from dotenv import load_dotenv
from pydantic_settings import BaseSettings
from pathlib import Path
from typing import List


class APPConfigSettings(BaseSettings):
    load_dotenv()

    APP_HOST: str
    APP_PORT: int
    BASE_DIR: Path = Path(__file__).parent.parent

    CORS_ORIGINS: List = ["*"]
    CORS_ALLOW_CREDENTIALS: bool = True
    CORS_ALLOW_METHODS: List = ["*"]
    CORS_ALLOW_HEADERS: List = ["*"]

    DB_HOST: str
    DB_PORT: int
    DB_USER: str
    DB_PASSWORD: str
    DB_DATABASE: str = 'demo'

    ACCESS_TOKEN_EXPIRE_MINUTES: int
    SECRET_KEY: str
    ALGORITHM: str

setting = APPConfigSettings()
